/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-07-15     MBW       the first version
 */
#ifndef CONTROL_MOTOR_H_
#define CONTROL_MOTOR_H_
#include "sys.h"

#define MOTOR_M1          0
#define MOTOR_M2          1
#define MOTOR_M3          2
#define MOTOR_M4          3
//motorPWM_t电机PWM结构体
typedef struct
{
    unsigned int m1; //值范围：0-1000
    unsigned int m2;
    unsigned int m3;
    unsigned int m4;
    float thrust,roll,pitch,yaw,minthro,maxthro;
}motorPWM_t;
extern motorPWM_t motorPWM;
void powerControl(motorPWM_t *MotorData,unsigned char state);
void motorsSetRatio(unsigned int id, unsigned int ithrust);
void MX_TIM4_Init2(void);
#endif /* CONTROL_MOTOR_H_ */
